package com.wuyu.ibatis.binding;

import com.wuyu.ibatis.session.SqlSession;

import java.lang.reflect.Method;

public class PlainMethodInvoker implements MapperMethodInvoker {

    private final MapperMethod mapperMethod;

    public PlainMethodInvoker(MapperMethod mapperMethod) {
        super();
        this.mapperMethod = mapperMethod;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args, SqlSession sqlSession) throws Throwable {
        return mapperMethod.execute(sqlSession, args);
    }
}
